/*
 * Copyright (c) [2022] Huawei Technologies Co.,Ltd.All rights reserved.
 *
 * OpenArkCompiler is licensed under Mulan PSL v2.
 * You can use this software according to the terms and conditions of the Mulan PSL v2.
 * You may obtain a copy of Mulan PSL v2 at:
 *
 *     http://license.coscl.org.cn/MulanPSL2
 *
 * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR
 * FIT FOR A PARTICULAR PURPOSE.
 * See the Mulan PSL v2 for more details.
 */

#ifndef MAPLE_DRIVER_INCLUDE_DRIVER_OPTIONS_H
#define MAPLE_DRIVER_INCLUDE_DRIVER_OPTIONS_H

#include "cl_option.h"
#include "cl_parser.h"

#include <string>

static cl::OptionCategory &driverCategory = cl::CommandLine::GetCommandLine().defaultCategory;

static cl::OptionCategory &clangCategory = cl::CommandLine::GetCommandLine().clangCategory;
static cl::OptionCategory &hir2mplCategory = cl::CommandLine::GetCommandLine().hir2mplCategory;
static cl::OptionCategory &mpl2mplCategory = cl::CommandLine::GetCommandLine().mpl2mplCategory;
static cl::OptionCategory &meCategory = cl::CommandLine::GetCommandLine().meCategory;
static cl::OptionCategory &cgCategory = cl::CommandLine::GetCommandLine().cgCategory;
static cl::OptionCategory &asCategory = cl::CommandLine::GetCommandLine().asCategory;
static cl::OptionCategory &ldCategory = cl::CommandLine::GetCommandLine().ldCategory;

static cl::OptionCategory &dex2mplCategory = cl::CommandLine::GetCommandLine().dex2mplCategory;
static cl::OptionCategory &jbc2mplCategory = cl::CommandLine::GetCommandLine().jbc2mplCategory;
static cl::OptionCategory &ipaCategory = cl::CommandLine::GetCommandLine().ipaCategory;

namespace opts {

/* ##################### BOOL Options ############################################################### */

extern cl::Option<bool> version;
extern cl::Option<bool> o0;
extern cl::Option<bool> o1;
extern cl::Option<bool> o2;
extern cl::Option<bool> os;
extern cl::Option<bool> verify;
extern cl::Option<bool> decoupleStatic;
extern cl::Option<bool> bigendian;
extern cl::Option<bool> gconly;
extern cl::Option<bool> timePhase;
extern cl::Option<bool> genMeMpl;
extern cl::Option<bool> compileWOLink;
extern cl::Option<bool> genVtable;
extern cl::Option<bool> verbose;
extern cl::Option<bool> debug;
extern cl::Option<bool> withDwarf;
extern cl::Option<bool> withIpa;
extern cl::Option<bool> npeNoCheck;
extern cl::Option<bool> npeStaticCheck;
extern cl::Option<bool> npeDynamicCheck;
extern cl::Option<bool> npeDynamicCheckSilent;
extern cl::Option<bool> npeDynamicCheckAll;
extern cl::Option<bool> boundaryNoCheck;
extern cl::Option<bool> boundaryStaticCheck;
extern cl::Option<bool> boundaryDynamicCheck;
extern cl::Option<bool> boundaryDynamicCheckSilent;
extern cl::Option<bool> safeRegionOption;
extern cl::Option<bool> printDriverPhases;
extern cl::Option<bool> ldStatic;
extern cl::Option<bool> maplePhase;
extern cl::Option<bool> genMapleBC;
extern cl::Option<bool> genLMBC;
extern cl::Option<bool> profileGen;
extern cl::Option<bool> profileUse;

/* ##################### STRING Options ############################################################### */

extern cl::Option<std::string> help;
extern cl::Option<std::string> infile;
extern cl::Option<std::string> mplt;
extern cl::Option<std::string> partO2;
extern cl::List<std::string> jbc2mplOpt;
extern cl::List<std::string> hir2mplOpt;
extern cl::List<std::string> clangOpt;
extern cl::List<std::string> asOpt;
extern cl::List<std::string> ldOpt;
extern cl::List<std::string> dex2mplOpt;
extern cl::List<std::string> mplipaOpt;
extern cl::List<std::string> mplcgOpt;
extern cl::List<std::string> meOpt;
extern cl::List<std::string> mpl2mplOpt;
extern cl::Option<std::string> profile;
extern cl::Option<std::string> run;
extern cl::Option<std::string> optionOpt;
extern cl::List<std::string> ldLib;
extern cl::List<std::string> ldLibPath;
extern cl::List<std::string> enableMacro;
extern cl::List<std::string> disableMacro;
extern cl::List<std::string> includeDir;
extern cl::List<std::string> includeSystem;
extern cl::Option<std::string> output;
extern cl::Option<std::string> saveTempOpt;

/* ##################### DIGITAL Options ############################################################### */

extern cl::Option<uint32_t> helpLevel;

/* #################################################################################################### */

} /* opts */

#endif /* MAPLE_DRIVER_INCLUDE_DRIVER_OPTIONS_H */
